Can you walk me through how you'd implement a useDebounce hook that takes a value and a delay and returns the debounced value?
If the component using your hook unmounts before the timeout fires, what cleanup step is required?
What happens to the debounced output if the delay prop changes between renders?
You have a search input that triggers an API call on every keystroke. How would you integrate your useDebounce hook to reduce network traffic, and what edge cases would you watch for?
During a code review, a teammate notes that your hook's effect runs on every render. How would you modify the implementation to avoid unnecessary re‑executions?
If the API call fails, how do you ensure the debounced value still reflects the latest user input?
In a dashboard with dozens of widgets each using useDebounce, how would you assess the overall performance impact and mitigate any slowdown?
How would you adapt your hook to work correctly with server‑side rendering where setTimeout isn't available?
If you needed a single hook that could handle both debounce and throttle behavior, how would you design its API and internal logic?
Your team is migrating legacy class components that implement manual debouncing to a shared functional library using useDebounce across many products. What architectural plan would you propose to ensure consistency and avoid regressions?
How would you version, document, and deprecate this custom hook in a company‑wide component library to support future changes without breaking downstream applications?
If the organization wants to enforce that all network requests are debounced, how would you embed useDebounce at an architectural level—perhaps via a higher‑order fetch wrapper—and what trade‑offs would you consider?